<?php


function 
renderMenu($entities) {
    $first = true;
    foreach($entities as $k => $v) {
        echo ($first ? "": ", ") . "'" . ucfirst($v) . "s'";    
        $first = false;
    }
}

function
objectMenu($type) {
    echo '<button ng-click="edit   (\'" . $type . "\')" ng-disabled=" ' . $type . 'Editing"                         >Edit</button>';
    echo '       <button ng-click="cancel (\'' . $type . '\')" ng-disabled="!' . $type . 'Editing"                         >Cancel</button>';
    echo '       <button ng-click="save   (\'' . $type . '\')" ng-disabled="!' . $type . 'Editing || ' . $type . 'Form.$invalid"    >Save</button>';
    echo '        <button ng-click="destroy(\'' . $type . '\')" ng-disabled=" ' . $type . 'Editing"                         >Delete</button>';
}

function
renderList($type) {
    echo '<div class=" smooth-panel" ng-show="'.$type.'s.length">';
    echo '    <b>'.ucfirst($type).'s</b>';
    echo '    <input ng-model="'.$type.'Filter" placeholder="Search..."/>';  
    echo '    <div ng-repeat="e in '.$type.'s | filter:'.$type.'Filter">';
    echo '        <a ng-href="#/all/{{e.id}}/null/null" > &nbsp; {{ e.aid }} {{ e.mapid }} &nbsp; {{ e.username }} {{ e.name }} &nbsp;</a>';                
    echo '    </div>';
    echo '</div>';
}

function 
renderLists() {
    renderList('user');
    renderList('team');
    renderList('request');
    renderList('user');}

?>
